package com.server.entity;

import java.io.Serializable;
import java.util.List;

import javax.persistence.*;
import javax.xml.bind.annotation.XmlRootElement;


/**
 * The persistent class for the Area database table.
 * 
 */
@Entity
@XmlRootElement
@Table(schema="mhp")
public class Area implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="AreaId")
	private int areaId;

	private String areaName;
	
	
	@ManyToOne(cascade={CascadeType.PERSIST,CascadeType.MERGE})
	@JoinColumn(name="countryId",insertable=false, updatable=false)
	private Country country;	
	
	@OneToMany(mappedBy="area",cascade={CascadeType.PERSIST,CascadeType.MERGE})
	private List<City> cities;
	
	public Area() {
	}

	public int getAreaId() {
		return this.areaId;
	}

	public void setAreaId(int areaId) {
		this.areaId = areaId;
	}

	public String getAreaName() {
		return this.areaName;
	}

	public void setAreaName(String areaName) {
		this.areaName = areaName;
	}

}